package com.ny.demo429;

public class che extends Test02{
    private int number;
    private double price;
    private double money;
    private double money1;

    public che(int number, double price) {
        this.number = number;
        this.price = price;
    }

    @Override
    public double chexian() {
        if (number==0){
            money1 = price*0.02;
            money=money1;
        }else if(number==1){
            money = money1+price*0.1;
        }else if (number>1){
            money = money1+price*0.2;
        }

        return money;
    }
    private double price1;
    private int mianji;
    private double sum;
    private double sum1;

    public che(double price1, int mianji) {
        this.price1 = price1;
        this.mianji = mianji;
    }

    @Override
    public double jiating() {
        if (mianji<=100){
            sum1 = price1*0.015;
            sum=sum1;
        }else {
            sum = sum1+sum1*0.05;
        }
        return sum;
    }
}
